package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepTrainValidationMapper;
import com.ruoyi.deeplearn.domain.DeepTrainValidation;
import com.ruoyi.deeplearn.service.IDeepTrainValidationService;

/**
 * 训练验证数据集Service业务层处理
 * 
 * @author rww
 * @date 2022-12-10
 */
@Service
public class DeepTrainValidationServiceImpl implements IDeepTrainValidationService 
{
    @Autowired
    private DeepTrainValidationMapper deepTrainValidationMapper;

    /**
     * 查询训练验证数据集
     * 
     * @param id 训练验证数据集主键
     * @return 训练验证数据集
     */
    @Override
    public DeepTrainValidation selectDeepTrainValidationById(Long id)
    {
        return deepTrainValidationMapper.selectDeepTrainValidationById(id);
    }

    /**
     * 查询训练验证数据集列表
     * 
     * @param deepTrainValidation 训练验证数据集
     * @return 训练验证数据集
     */
    @Override
    public List<DeepTrainValidation> selectDeepTrainValidationList(DeepTrainValidation deepTrainValidation)
    {
        return deepTrainValidationMapper.selectDeepTrainValidationList(deepTrainValidation);
    }

    /**
     * 新增训练验证数据集
     * 
     * @param deepTrainValidation 训练验证数据集
     * @return 结果
     */
    @Override
    public int insertDeepTrainValidation(DeepTrainValidation deepTrainValidation)
    {
        deepTrainValidation.setId(IdUtil.getSnowflakeNextId());
        deepTrainValidation.setCreateTime(DateUtils.getNowDate());
        return deepTrainValidationMapper.insertDeepTrainValidation(deepTrainValidation);
    }

    /**
     * 修改训练验证数据集
     * 
     * @param deepTrainValidation 训练验证数据集
     * @return 结果
     */
    @Override
    public int updateDeepTrainValidation(DeepTrainValidation deepTrainValidation)
    {
        deepTrainValidation.setUpdateTime(DateUtils.getNowDate());
        return deepTrainValidationMapper.updateDeepTrainValidation(deepTrainValidation);
    }

    /**
     * 批量删除训练验证数据集
     * 
     * @param ids 需要删除的训练验证数据集主键
     * @return 结果
     */
    @Override
    public int deleteDeepTrainValidationByIds(Long[] ids)
    {
        return deepTrainValidationMapper.deleteDeepTrainValidationByIds(ids);
    }

    /**
     * 删除训练验证数据集信息
     * 
     * @param id 训练验证数据集主键
     * @return 结果
     */
    @Override
    public int deleteDeepTrainValidationById(Long id)
    {
        return deepTrainValidationMapper.deleteDeepTrainValidationById(id);
    }
}
